package com.jkc.xh.manager;

import com.jkc.xh.models.BindBankCardModel;
import com.jkc.xh.network.ApiClient;
import com.jkc.xh.network.RestCallBack;
import com.jkc.xh.network.models.BankListResponse;
import com.jkc.xh.network.models.BankSubListResponse;
import com.jkc.xh.network.models.BindCardRequest;
import com.jkc.xh.network.models.CityListResponse;
import com.jkc.xh.network.models.MagicBeanResponse;
import com.jkc.xh.network.models.OpenRedbagResponse;
import com.jkc.xh.network.models.PaywayResponse;
import com.jkc.xh.network.models.ProvinceListResponse;
import com.jkc.xh.network.models.RedbagResponse;
import com.jkc.xh.network.models.RefferFriendResponse;
import com.jkc.xh.network.models.RefundCashRequest;
import com.jkc.xh.network.models.ResponseEntity;

import retrofit.Call;

/**
 * 资产信息类接口
 * Created by zhangbreeze on 2015/12/1.
 */
public class MoneyManager {

    /*3100 充值方式*/
    public static Call getPayways(final RestCallBack<PaywayResponse> callBack) {
        final Call<ResponseEntity<PaywayResponse>> call = ApiClient.getApiService().getPayways();
        call.enqueue(callBack);
        return call;
    }

    /**
     * 3102 我要提现
     */
    public static Call doRefundCash(String money, String desc, final RestCallBack<Object> callBack) {
        final Call<ResponseEntity<Object>> call = ApiClient.getApiService().doRefundCash(new RefundCashRequest(money, desc));
        call.enqueue(callBack);
        return call;
    }

    /**
     * 3104 抵用券记录
     */
    public static Call getMagicBeanList(int pageIndex, final RestCallBack<MagicBeanResponse> callBack) {
        final Call<ResponseEntity<MagicBeanResponse>> call = ApiClient.getApiService().getMagicBeanList(pageIndex);
        call.enqueue(callBack);
        return call;
    }

    /**
     * 3105 我的红包
     */
    public static Call getRedbagList(int pageIndex, final RestCallBack<RedbagResponse> callBack) {
        final Call<ResponseEntity<RedbagResponse>> call = ApiClient.getApiService().getRedbagList(pageIndex);
        call.enqueue(callBack);
        return call;
    }

    /**
     * 3106 打开红包
     */
    public static Call openRedbag(int badId, final RestCallBack<OpenRedbagResponse> callBack) {
        final Call<ResponseEntity<OpenRedbagResponse>> call = ApiClient.getApiService().doOpenRedbag(badId);
        call.enqueue(callBack);
        return call;
    }

    /**
     * 3004 推广明细
     *
     * @param pageIndex
     * @param callBack
     * @return
     */
    public static Call getRefferFriendList(int pageIndex, final RestCallBack<RefferFriendResponse> callBack) {
        final Call<ResponseEntity<RefferFriendResponse>> call = ApiClient.getApiService().getRefferFriendList(pageIndex);
        call.enqueue(callBack);
        return call;
    }

    public static Call getBankList(final RestCallBack<BankListResponse> callBack) {
        final Call<ResponseEntity<BankListResponse>> call = ApiClient.getApiService().getBankList();
        call.enqueue(callBack);
        return call;
    }

    public static Call getProvinceList(final RestCallBack<ProvinceListResponse> callBack) {
        final Call<ResponseEntity<ProvinceListResponse>> call = ApiClient.getApiService().getProvinceList();
        call.enqueue(callBack);
        return call;
    }

    public static Call getCityList(long prov_cd, final RestCallBack<CityListResponse> callBack) {
        final Call<ResponseEntity<CityListResponse>> call = ApiClient.getApiService().getCityList(prov_cd);
        call.enqueue(callBack);
        return call;
    }

    public static Call getSubBankList(long bank_id, long city_cd, final RestCallBack<BankSubListResponse> callBack) {
        final Call<ResponseEntity<BankSubListResponse>> call = ApiClient.getApiService().getBankSubList(bank_id, city_cd);
        call.enqueue(callBack);
        return call;

    }

    public static Call bindCard(BindCardRequest request, final RestCallBack<Object> callBack) {
        final Call<ResponseEntity<Object>> call = ApiClient.getApiService().bindBankCard(request);
        call.enqueue(callBack);
        return call;
    }

    public static Call getBindCardInfo(final RestCallBack<BindBankCardModel> callBack){
        final Call<ResponseEntity<BindBankCardModel>> call = ApiClient.getApiService().getBindBankInfo();
        call.enqueue(callBack);
        return call;
    }
}
